//
//  ZyaButtonPocket.swift
//  SlaughterClient
//
//  Created by 邱仙凯 on 2021/3/24.
//  Copyright © 2021 zwb. All rights reserved.
//

import UIKit

class ZyaButtonPocket {
    static let shared = ZyaButtonPocket()
    private init() {}
    private var btnDic: [String: GSCaptchaButton]  = [:]
    func getCountDownBtn(id:String) -> GSCaptchaButton {
        
        if let btn = btnDic[id] {
            return btn
        } else {
            let view = GSCaptchaButton()
            view.frame = CGRect(x: 20, y: 5, width: KSGlobal.screenW - 40, height: 35)
            view.layer.borderWidth = 1
            view.layer.cornerRadius = 5
            view.layer.masksToBounds = true
            view.layer.borderColor = Theme.primaryColor().cgColor
            view.setTitleColor(Theme.primaryColor(), for: .normal)
            view.setTitle("我已转账", for: .normal)
            view.backgroundColor = .white
            view.setTitle("second秒后重试", for: .disabled)
            view.setBackgroundImage(UIImage.from(color: .lightGray), for: .disabled)
            view.setTitleColor(.white, for: .disabled)
            btnDic[id] = view
            return view
        }
         
    }
}
